package com.relax.game.casino.forward;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.red5.server.adapter.ApplicationAdapter;
import org.red5.server.api.IConnection;
import org.red5.server.api.IScope;
import org.red5.server.api.service.ServiceUtils;

public class Main extends ApplicationAdapter {
	private static final Log log = LogFactory.getLog(Main.class);
	
	public boolean connect(IConnection connection, IScope scope, Object[] params) {
		log.info("client connected");
		String username = (String)params[0];
		String password = (String)params[1];
		if (!username.equals("vunh") || !password.equals("1234")) return false;
		ServiceUtils.invokeOnConnection(connection, "connected", new Object[]{});
		return true;
	}
}
